import 'package:json_annotation/json_annotation.dart';
import 'package:laos_mall/models/category/product_list_model.dart';

part 'collect_model.g.dart';


@JsonSerializable()
class CollectModel extends Object {

  List<CollectItemModel>? filter_result;

  int? total;

  Filter? filter;

  int errcode;

  String message;

  CollectModel(this.filter_result,this.total,this.filter,this.errcode,this.message,);

  factory CollectModel.fromJson(Map<String, dynamic> srcJson) => _$CollectModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CollectModelToJson(this);

}


@JsonSerializable()
class CollectItemModel extends Object {

  int collect_id;

  int user_id;

  int product_id;

  String add_time;

  String product_name;

  String product_sn;

  String pic_thumb;

  String market_price;

  int is_promote;

  String product_price;

  int product_stock;

  String username;

  int rank_id;

  List<ProductSku>? product_sku;

  CollectItemModel(this.collect_id,this.user_id,this.product_id,this.add_time,this.product_name,this.product_sn,this.pic_thumb,this.market_price,this.is_promote,this.product_price,this.product_stock,this.username,this.rank_id,this.product_sku,);

  factory CollectItemModel.fromJson(Map<String, dynamic> srcJson) => _$CollectItemModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CollectItemModelToJson(this);

}


@JsonSerializable()
class Filter extends Object {

  String keyword;

  int page;

  int size;

  String sort_field;

  String sort_order;

  Filter(this.keyword,this.page,this.size,this.sort_field,this.sort_order,);

  factory Filter.fromJson(Map<String, dynamic> srcJson) => _$FilterFromJson(srcJson);

  Map<String, dynamic> toJson() => _$FilterToJson(this);

}


